import { FilterConst } from "../../../../component/gconst/FilterConst";
import { GlobalClass } from "../../../../../com/mui/core/GlobalClass";
import { ImagesConst } from "../../../resource/ImagesConst";
type int = number;
//class Lv70DramaMapTabItem
    
    export  class Lv70DramaMapTabItem /* flash.display.Sprite */
    {
        constructor(arg1: int, arg2: Object /* flash.display.Bitmap */)
        {
            
            this._mapId = arg1;
            this._layer = arg2;
            this._isSelected = false;
            this.init();
            return;
        }

        public set enabled(arg1: Boolean)
        {
            this.mouseEnabled = arg1;
            this.mouseChildren = arg1;
            if (arg1) 
            {
                this.filters = [];
            }
            else 
            {
                this.filters = [FilterConst.colorFilter];
            }
            return;
        }

        public get mapId(): int
        {
            return this._mapId;
        }

        /* internal  */init(): void
        {
            this._overSkin = new Object /* flash.display.Bitmap */();
            this._upSkin = new Object /* flash.display.Bitmap */();
            this._selectedSkin = new Object /* flash.display.Bitmap */();
            this._enableSkin = new Object /* flash.display.Bitmap */();
            this._overSkin.bitmapData = GlobalClass.getBitmapData(ImagesConst.Lv70DramaMapTabOver);
            this._upSkin.bitmapData = GlobalClass.getBitmapData(ImagesConst.Lv70DramaMapTabUp);
            this._selectedSkin.bitmapData = GlobalClass.getBitmapData(ImagesConst.Lv70DramaMapTabSelected);
            this._enableSkin.bitmapData = GlobalClass.getBitmapData(ImagesConst.Lv70DramaMapTabDisable);
            this._enableSkin.visible = false;
            this.addChild(this._overSkin);
            this.addChild(this._upSkin);
            this.addChild(this._selectedSkin);
            this.addChild(this._enableSkin);
            this._layer.y = this.LayerStartY;
            this.addChild(this._layer);
            this.addEventListener(flash.events.MouseEvent.MOUSE_OVER, this.mouseOverHandler);
            this.addEventListener(flash.events.MouseEvent.MOUSE_OUT, this.mouseOutHandler);
            this.focusOut();
            this.buttonMode = true;
            return;
        }

        public focusOut(): void
        {
            if (this._isSelected) 
            {
                return;
            }
            this._overSkin.visible = false;
            this._upSkin.visible = true;
            this._selectedSkin.visible = false;
            return;
        }

        public focusIn(): void
        {
            if (this._isSelected) 
            {
                return;
            }
            this._overSkin.visible = true;
            this._upSkin.visible = false;
            this._selectedSkin.visible = false;
            return;
        }

        public get selected(): Boolean
        {
            return this._isSelected;
        }

        public set selected(arg1: Boolean)
        {
            if (arg1 == this._isSelected) 
            {
                return;
            }
            this._isSelected = arg1;
            this._overSkin.visible = !this._isSelected;
            this._upSkin.visible = !this._isSelected;
            this._selectedSkin.visible = this._isSelected;
            if (this._isSelected) 
            {
                this._layer.y = this.LayerStartY - 8;
                this.buttonMode = false;
            }
            else 
            {
                this._layer.y = this.LayerStartY;
                this.buttonMode = true;
            }
            return;
        }

        /* internal  */mouseOverHandler(arg1: Object /* flash.events.MouseEvent */): void
        {
            this.focusIn();
            return;
        }

        /* internal  */mouseOutHandler(arg1: Object /* flash.events.MouseEvent */): void
        {
            this.focusOut();
            return;
        }

        /* internal */ /* const */LayerStartY: int=20;

        /* internal */ /* var */_mapId: int;

        /* internal */ /* var */_layer: Object /* flash.display.Bitmap */;

        /* internal */ /* var */_overSkin: Object /* flash.display.Bitmap */;

        /* internal */ /* var */_upSkin: Object /* flash.display.Bitmap */;

        /* internal */ /* var */_enableSkin: Object /* flash.display.Bitmap */;

        /* internal */ /* var */_selectedSkin: Object /* flash.display.Bitmap */;

        /* internal */ /* var */_isSelected: Boolean;
    }
